package com.yzh.homework.homework04;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 于振晗
 * @title: Cat
 * @description: TODO 车类
 * @date 2020年08月26日
 * @path com.yzh.homework.homework04
 */
public class Car {
    private String type;
    private String number;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public Car(String type, String number) {
        this.type = type;
        this.number = number;
    }

    public void start(){
        System.out.println("我是车,我启动");
    }

    public void stop(){
        System.out.println("我试车,我停止");
    }

    public void introduce(){
        System.out.println("");
    }
}

class PrivateCar extends Car{
    private String carMaster;

    public PrivateCar(String type, String number, String carMaster) {
        super(type, number);
        this.carMaster = carMaster;
    }

    @Override
    public void introduce(){
        System.out.println("我是"+carMaster+",我的汽车我做主");
        System.out.println("目的地到了,我们去玩吧!");
    }
}

class Taxi extends Car{
    private String company;

    public Taxi(String type, String number, String company) {
        super(type, number);
        this.company = company;
    }

    @Override
    public void introduce(){
        System.out.println("乘客您好");
        System.out.println("我是"+company+"出租车公司的,我的车牌是"+getNumber()+",您要去哪里?");
        System.out.println("目的地已经到了.请您付费下车,欢迎下次乘坐!");
    }
}


class Test{
    public static void main(String[] args) {
        PrivateCar privateCar = new PrivateCar("宝马", "豫G-123", "小三");
        privateCar.introduce();

        System.out.println("========================================");
        Taxi taxi = new Taxi("出租车", "京A-123", "景顺");
        taxi.introduce();

        List list = new ArrayList<String>();
        System.out.println(list instanceof ArrayList);
    }
}